Pulse width modulation (PWM) is a commonly used technique for generating precisely timed, repetitive digital waveforms. Resolution of a PWM waveform plays an important role in the quality of output generated. The granularity or resolution of the device output state depends upon the resolution of the PWM output used to control the device. For a given range of output states, higher resolution in the PWM translates into higher resolution of the device being controlled thereby. Resolution enhancements have typically relied upon hardware alterations on the controller side to provide for more PWM states at the output. However, such hardware based approaches are typically fraught with significant cost penalties and use of non-standardized components.
General-purpose microcontrollers are used for generation of Pulse Width Modulation (PWM) waveforms for different applications. Sine wave generation is one of the most useful applications where the PWM function of timers can be used. Sine wave resolution can be improved by improving PWM duty cycle resolution. One of most useful applications is Uninterruptible Power Supplies (UPSs) where sine wave resolution is important. Also in some applications if AC Mains frequency changes to a large extent, it may cause temporary or permanent damage to the operating device. During the change in AC Mains frequency, it is necessary to track the same.
While any variety of digital waveforms can be generated by periodically writing to the various ports of digital ICs, using timer output capture and the like, these all require direct CPU time for each output pulse. A great advantage of PWM is that once the registers are set up and enabled, the PWM waveforms are generated without any CPU overhead, so valuable CPU time can be utilized for other tasks.
However there are certain drawbacks to the same. Resolution of the pulse width modulated signal, which must be significantly higher than the input frequency, typically does not approach that of the input itself. A further problem that reduces available PWM accuracy and resolution is associated with timer interrupt latency inherent in current microprocessor-based control schemes. That is, transitions of the pulse width modulated signal from high to low and low to high are handled by a pulse width timer interrupt routine in software. Depending upon the instructions being executed when a pulse width timer interrupt occurs, four to seven microseconds can elapse before the software interrupt routine is executed. There is thus a quasi-random timing error of up to three microseconds, which can be viewed as noise on the PWM signal that adversely affects system performance, particularly in high response systems.
U.S. Pat. No. 5,023,535 entitled “HIGH RESOLUTION PULSE WIDTH MODULATION” provides a high-resolution pulse width modulation waveform using software, but the change in high time of pulse width modulated waveform is in multiple (s) of a microprocessor/microcontroller clock period.
A system that addresses the foregoing problems in the art and provide resolution up to a fraction of the time period of Central Processing Unit (TCPU) is required.